<%@ page import="com.sdgakj.entity.User" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no,
    initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
   <%-- <script src="${ctx}/static/h5/js/public/loginFilter.js"></script>--%>
    <link rel="stylesheet" href="${ctx}/static/h5/css/public/bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="${ctx}/static/h5/css/personal/index.css" type="text/css">
    <script src="${ctx}/static/h5/js/public/jquery-2.2.3.min.js"></script>
    <title>云谱</title>
</head>
<body id="ancestor">
<header>
    <input id="mess" type="hidden" value="${mess}">
    <input id="userId" type="hidden" value="${userId}">
    <input id="personId" type="hidden" value="${personId}">
    <input id="mobile" type="hidden" value="${mobile}">
    <script>
        $(function () {
            var mess = $("#mess").val();
            var userId = $("#userId").val();
            var personId = $("#personId").val();
            var mobile = $("#mobile").val();
            if(mess=='0'){
                localStorage.removeItem("userId");
                localStorage.setItem("userId",userId);
                localStorage.removeItem("personId");
                localStorage.setItem("personId",personId)
                localStorage.removeItem("mobile");
                localStorage.setItem("mobile",mobile);
                window.location.href="/h5/index/home";
            }
        })
    </script>
    <h4>云谱</h4>
    <div class="header-img dropdown">
        <a href="/h5/family/seache"><img src="${ctx}/static/h5/images/seacher.png" alt=""/></a>
        <%--<img src="${ctx}/static/h5/images/add1.png" class="dropdown-toggle" id="dropdownMenu" data-toggle="dropdown" alt=""/>--%>
        <%--<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">--%>
            <%--<li role="presentation">--%>
                <%--<a role="menuitem" tabindex="-1" href="#">--%>
                <%--<img src="${ctx}/static/h5/images/add-friend.png" alt=""/>家族列表--%>
            <%--</a>--%>
            <%--</li>--%>
            <%--<li role="presentation">--%>
                <%--<a role="menuitem" tabindex="-1" href="#">--%>
                    <%--<img src="${ctx}/static/h5/images/saoyisao.png" alt=""/>扫一扫--%>
                <%--</a>--%>
            <%--</li>--%>
        <%--</ul>--%>
    </div>
</header>
    <%--消息开始--%>
<%--  重复  <section class="tab-content">
       <div id="message" class="tab-pane fade in active">
           <ul>
               <c:forEach items="${feeds.content}" var="feed">
                   <li>
                           &lt;%&ndash;    <c:if test="${feed.feedTag.id == '1'}">
                               </c:if>&ndash;%&gt;
                       <a href="/h5/feed/feedDetail?id=${feed.id}&tagid=${feed.feedTag.id}">
                           <img src="${ctx}/static/h5/images/dashiji1.png" alt=""/>
                           <span>${feed.content}</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>${feed.createDate}</span>
                           <input type="text" class="apply_put" id="tagid" value="${feed.feedTag.id}">
                       </a>
                   </li>
               </c:forEach>
           </ul>
       </div>
   </section>--%>
    <section class="tab-content">
    <div id="mesager" class="tab-pane fade in active">
        <ul>
           <c:forEach items="${today}" var="feed">
                <li>
                    <a href="" class="detail">
                        <input hidden="hidden" class="fid" value="${feed.id}">
                        <input hidden="hidden" class="tagId" value="${feed.feedTag.id}">
                            <c:if test="${feed.feedTag.id==1}">
                                <img src="${ctx}/static/h5/images/family_circle.png" alt=""/>
                            </c:if>
                            <c:if test="${feed.feedTag.id==2}">
                                <img src="${ctx}/static/h5/images/index_note.png" alt=""/>
                            </c:if>
                            <c:if test="${feed.feedTag.id==3}">
                                <img src="${ctx}/static/h5/images/index_dynamic.png" alt=""/>
                            </c:if>
                            <c:if test="${feed.feedTag.id==4}">
                                <img src="${ctx}/static/h5/images/index_share.png" alt=""/>
                            </c:if>
                            <c:if test="${feed.feedTag.id==5}">
                                <img src="${ctx}/static/h5/images/index_process.png" alt=""/>
                            </c:if>
                        <span class="span-content">${feed.content}</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="updata-time"><fmt:formatDate value="${feed.createDate}" pattern="HH"/>:<fmt:formatDate value="${feed.createDate}" pattern="mm"/></span>
                        <input type="text" class="apply_put"  hidden="hidden" value="${feed.feedTag.id}">
                    </a>
                </li>
           </c:forEach>
           <c:forEach items="${yesterday}" var="feed">
                <li>
                    <a href="" class="detail">
                        <input hidden="hidden" class="fid" value="${feed.id}">
                        <input hidden="hidden" class="tagId" value="${feed.feedTag.id}">
                            <c:if test="${feed.feedTag.id==1}">
                                <img src="${ctx}/static/h5/images/family_circle.png" alt=""/>
                            </c:if>
                            <c:if test="${feed.feedTag.id==2}">
                                <img src="${ctx}/static/h5/images/index_note.png" alt=""/>
                            </c:if>
                            <c:if test="${feed.feedTag.id==3}">
                                <img src="${ctx}/static/h5/images/index_dynamic.png" alt=""/>
                            </c:if>
                            <c:if test="${feed.feedTag.id==4}">
                                <img src="${ctx}/static/h5/images/index_share.png" alt=""/>
                            </c:if>
                            <c:if test="${feed.feedTag.id==5}">
                                <img src="${ctx}/static/h5/images/index_process.png" alt=""/>
                            </c:if>
                        <span class="span-content">${feed.content}</span > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="updata-time"><fmt:formatDate value="${feed.createDate}" pattern="MM"/>月<fmt:formatDate value="${feed.createDate}" pattern="dd"/>日</span>
                        <input type="text" class="apply_put"  hidden="hidden" value="${feed.feedTag.id}">
                    </a>
                </li>
           </c:forEach>
        </ul>
    </div>
</section>

<footer class="footer">
    <ul class="nav nav-pills">
        <li class="active">
            <a href="/h5/index/home" class="mesager">消息</a>
        </li>
        <li>
            <a href="/h5/family/" class="family">家族</a>
        </li>
        <li>
            <a href="/h5/find/" class="find">发现</a>
        </li>
        <li>
            <a href="/h5/user/mzone" class="myself"> 我的</a>
        </li>
    </ul>
</footer>
</body>

<script src="${ctx}/static/h5/js/public/bootstrap.min.js"></script>
<script src="${ctx}/static/h5/js/personal/index.js"></script>
<script>
    $(function () {
        //首页展示
        var userId=localStorage.getItem("userId");
        $(".mesager").on("click",function () {
            var url="";
            if(userId == "" || userId == null){
                url="/h5/user/login";
            }else {
                url="/h5/index/home?userId="+userId
            }
            $(this).attr("href",url);
        })
        //详情
        $(".detail").on("click",function () {
            var id=$(this).children(".fid").val();
            var tagid=$(this).children(".tagId").val();
            var url="/h5/feed/feedDetail?userId="+userId+"&id="+id+"&tagid="+tagid;
            $(this).attr("href",url);
        })
        //家族
        $(".family").on("click",function () {
            var url="";
            if(userId == "" || userId == null){
                url="/h5/user/login";
            }else {
                url="/h5/family/family?userId="+userId
            }
            $(this).attr("href",url);
        })
        //我的
        $(".myself").on("click",function () {
            var url="";
            if(userId == "" || userId == null){
                url="/h5/user/login";
            }else {
                url="/h5/user/mzone?userId="+userId
            }
            $(this).attr("href",url);
        })
    })
</script>
</html>

